﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:include schemaLocation="pattern-enforcer-types.xsd"/>

  <xs:element name="config" type="ArchitectureExplorerConfig"/>
    
  <xs:complexType name="ArchitectureExplorerConfig">
    <xs:annotation>
      <xs:documentation>
        The root element of Architecture Explorer configuration, which 
        is an extension to Pattern Enforcer configuration.
      </xs:documentation>
    </xs:annotation>

    <xs:complexContent>
      <xs:extension base="Config"> <!-- Pattern Enforcer Config type -->
        <xs:sequence>
          <xs:element name="ignore-namespaces" type="NamespacesIgnoreList" nillable="false" maxOccurs="1"/>
          <xs:element name="ignore-types" type="TypesIgnoreList" nillable="false" maxOccurs="1"/>
		  <xs:element name="ignore-members" type="MembersIgnoreList" nillable="false" maxOccurs="1"/>
          <xs:element name="dot" nillable="false" maxOccurs="1">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="graph-attributes" type="DotAttributesList" nillable="false" maxOccurs="1"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element> 
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

  <xs:complexType name="NamespacesIgnoreList">
    <xs:annotation>
      <xs:documentation>
        The list of beginnings of namespaces that should be ignored during the reverse engineering. 
        If Architecture Explorer finds a namespace that starts with one of these strings, it will ignore it. 
        No wildcars are supported.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="namespace" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="TypesIgnoreList">
    <xs:annotation>
      <xs:documentation>
        The list of regular expressions for matching names of types 
        that should be ignored during the reverse engineering.
        Remember that use of dot '.' must be escaped.
        If Architecture Explorer finds a type that matches one these expressions, 
        it will ignore it.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="type" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="MembersIgnoreList">
    <xs:annotation>
      <xs:documentation>
        The list of regular expressions for matching names of members (properties, methods, field, etc.)
        that should be ignored during the reverse engineering.
        Remember that use of dot '.' must be escaped.
        If Architecture Explorer finds a member that matches one these expressions,
        it will ignore it.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="member" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="DotAttributesList">
    <xs:annotation>
      <xs:documentation>
        The list of key-value pairs. These will be added to the input file 
        for the Graphviz as graph attributes. 
        For more information about supported attributes, see the DOT documentation.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="value" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  
</xs:schema>